import ReactDOM from 'react-dom/client'
import App from './App'
import axios from 'axios'
import { QueryClient, QueryClientProvider} from 'react-query'
import "./index.css"

// 响应拦截器，让开发者直接获取到服务器端返回的数据
axios.interceptors.response.use(response => response.data)
axios.defaults.baseURL = 'http://localhost:3001'

// 创建 queryClient 对象
const queryClient = new QueryClient()

const root = ReactDOM.createRoot(document.getElementById('root'))

root.render(
  /* 将queryClient 对象传递到下层组件 */
  <QueryClientProvider client={queryClient}>
    <App />
  </QueryClientProvider>
)
